package com.test;

import com.lynx.core.ApiResult;
import com.lynx.core.ApiUser;
import com.lynx.core.View;
import com.lynx.core.impl.DispatcherView;
import com.lynx.core.impl.JspView;
import com.lynx.core.impl.RedirectView;
import com.lynx.core.impl.TextView;
import com.lynx.core.tation.ApiPath;
import com.lynx.core.type.PathType;
import com.lynx.core.type.PatternType;
/**
 * 
 * @author lxp
 *
 */

public class test{
	
	
	@ApiPath(Path = "/user/GetTest",model=UserInfo.class,Type=PathType.post)
	public static View GetTest(ApiResult result, ApiUser user) throws Exception {
		UserInfo userInfo = (UserInfo)result.getModel();
		System.out.println(result.getParam("name",String.class));
		System.out.println(userInfo.getDate());
		return new TextView(String.valueOf(userInfo.getName()));
	}
	
	@ApiPath(Path = "/user/GetTest1")
	public static View GetTest1(ApiResult result, ApiUser user) throws Exception {
		System.out.println(result.getParam("id_",String.class));
		return new DispatcherView("/index.jsp");
	}
	
	
	@ApiPath(Path = "/user/GetTest2")
	public static View GetTest2(ApiResult result, ApiUser user) throws Exception {
		return new DispatcherView("/user/GetTest1.do?id_=aaaaa");
	}
	@ApiPath(Path = "/user/GetTest3")
	public static View GetTest3(ApiResult result, ApiUser user) throws Exception {
		return new RedirectView("/index.jsp");
	}
	@ApiPath(Path = "/user/GetTest4")
	public static View GetTest4(ApiResult result, ApiUser user) throws Exception {
		return new RedirectView("/index.jsp");
	}
	
	
}